3.127 \(\int \frac {\cos (c+d x)}{(a+i a \tan (c+d x))^2} \, dx\)

Optimal. Leaf size=71 \[ -\frac {\sin ^3(c+d x)}{5 a^2 d}+\frac {3 \sin (c+d x)}{5 a^2 d}+\frac {2 i \cos ^3(c+d x)}{5 d \left (a^2+i a^2 \tan (c+d x)\right )} \]

[Out]

3/5*sin(d*x+c)/a^2/d-1/5*sin(d*x+c)^3/a^2/d+2/5*I*cos(d*x+c)^3/d/(a^2+I*a^2*tan(d*x+c))

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 71, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {3500, 2633} \[ -\frac {\sin ^3(c+d x)}{5 a^2 d}+\frac {3 \sin (c+d x)}{5 a^2 d}+\frac {2 i \cos ^3(c+d x)}{5 d \left (a^2+i a^2 \tan (c+d x)\right )} \]

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]/(a + I*a*Tan[c + d*x])^2,x]

[Out]

(3*Sin[c + d*x])/(5*a^2*d) - Sin[c + d*x]^3/(5*a^2*d) + (((2*I)/5)*Cos[c + d*x]^3)/(d*(a^2 + I*a^2*Tan[c + d*x
]))

Rule 2633

Int[sin[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[Expand[(1 - x^2)^((n - 1)/2), x], x], x
, Cos[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[(n - 1)/2, 0]

Rule 3500

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(2*d^2
*(d*Sec[e + f*x])^(m - 2)*(a + b*Tan[e + f*x])^(n + 1))/(b*f*(m + 2*n)), x] - Dist[(d^2*(m - 2))/(b^2*(m + 2*n
)), Int[(d*Sec[e + f*x])^(m - 2)*(a + b*Tan[e + f*x])^(n + 2), x], x] /; FreeQ[{a, b, d, e, f, m}, x] && EqQ[a
^2 + b^2, 0] && LtQ[n, -1] && ((ILtQ[n/2, 0] && IGtQ[m - 1/2, 0]) || EqQ[n, -2] || IGtQ[m + n, 0] || (Integers
Q[n, m + 1/2] && GtQ[2*m + n + 1, 0])) && IntegerQ[2*m]

Rubi steps

\begin {align*} \int \frac {\cos (c+d x)}{(a+i a \tan (c+d x))^2} \, dx &=\frac {2 i \cos ^3(c+d x)}{5 d \left (a^2+i a^2 \tan (c+d x)\right )}+\frac {3 \int \cos ^3(c+d x) \, dx}{5 a^2}\\ &=\frac {2 i \cos ^3(c+d x)}{5 d \left (a^2+i a^2 \tan (c+d x)\right )}-\frac {3 \operatorname {Subst}\left (\int \left (1-x^2\right ) \, dx,x,-\sin (c+d x)\right )}{5 a^2 d}\\ &=\frac {3 \sin (c+d x)}{5 a^2 d}-\frac {\sin ^3(c+d x)}{5 a^2 d}+\frac {2 i \cos ^3(c+d x)}{5 d \left (a^2+i a^2 \tan (c+d x)\right )}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.33, size = 68, normalized size = 0.96 \[ \frac {\sec (c+d x) (4 i \cos (2 (c+d x))+5 \tan (c+d x)-3 \sin (3 (c+d x)) \sec (c+d x)-12 i)}{20 a^2 d (\tan (c+d x)-i)^2} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]/(a + I*a*Tan[c + d*x])^2,x]

[Out]

(Sec[c + d*x]*(-12*I + (4*I)*Cos[2*(c + d*x)] - 3*Sec[c + d*x]*Sin[3*(c + d*x)] + 5*Tan[c + d*x]))/(20*a^2*d*(
-I + Tan[c + d*x])^2)

________________________________________________________________________________________

fricas [A]  time = 0.68, size = 52, normalized size = 0.73 \[ \frac {{\left (-5 i \, e^{\left (6 i \, d x + 6 i \, c\right )} + 15 i \, e^{\left (4 i \, d x + 4 i \, c\right )} + 5 i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i\right )} e^{\left (-5 i \, d x - 5 i \, c\right )}}{40 \, a^{2} d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)/(a+I*a*tan(d*x+c))^2,x, algorithm="fricas")

[Out]

1/40*(-5*I*e^(6*I*d*x + 6*I*c) + 15*I*e^(4*I*d*x + 4*I*c) + 5*I*e^(2*I*d*x + 2*I*c) + I)*e^(-5*I*d*x - 5*I*c)/
(a^2*d)

________________________________________________________________________________________

giac [A]  time = 1.62, size = 93, normalized size = 1.31 \[ \frac {\frac {5}{a^{2} {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + i\right )}} + \frac {35 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 90 i \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 120 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 70 i \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 21}{a^{2} {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - i\right )}^{5}}}{20 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)/(a+I*a*tan(d*x+c))^2,x, algorithm="giac")

[Out]

1/20*(5/(a^2*(tan(1/2*d*x + 1/2*c) + I)) + (35*tan(1/2*d*x + 1/2*c)^4 - 90*I*tan(1/2*d*x + 1/2*c)^3 - 120*tan(
1/2*d*x + 1/2*c)^2 + 70*I*tan(1/2*d*x + 1/2*c) + 21)/(a^2*(tan(1/2*d*x + 1/2*c) - I)^5))/d

________________________________________________________________________________________

maple [A]  time = 0.42, size = 108, normalized size = 1.52 \[ \frac {\frac {2}{8 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+8 i}-\frac {2 i}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-i\right )^{4}}+\frac {5 i}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-i\right )^{2}}+\frac {4}{5 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-i\right )^{5}}-\frac {3}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-i\right )^{3}}+\frac {7}{4 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-i\right )}}{a^{2} d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)/(a+I*a*tan(d*x+c))^2,x)

[Out]

2/d/a^2*(1/8/(tan(1/2*d*x+1/2*c)+I)-I/(tan(1/2*d*x+1/2*c)-I)^4+5/4*I/(tan(1/2*d*x+1/2*c)-I)^2+2/5/(tan(1/2*d*x
+1/2*c)-I)^5-3/2/(tan(1/2*d*x+1/2*c)-I)^3+7/8/(tan(1/2*d*x+1/2*c)-I))

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: RuntimeError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)/(a+I*a*tan(d*x+c))^2,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: Error executing code in Maxima: expt: undefined: 0 to a negative e
xponent.

________________________________________________________________________________________

mupad [B]  time = 3.89, size = 90, normalized size = 1.27 \[ -\frac {2\,\left (-5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,10{}\mathrm {i}+10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-2{}\mathrm {i}\right )}{5\,a^2\,d\,{\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-\mathrm {i}\right )}^5\,\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1{}\mathrm {i}\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)/(a + a*tan(c + d*x)*1i)^2,x)

[Out]

-(2*(3*tan(c/2 + (d*x)/2) + 10*tan(c/2 + (d*x)/2)^3 + tan(c/2 + (d*x)/2)^4*10i - 5*tan(c/2 + (d*x)/2)^5 - 2i))
/(5*a^2*d*(tan(c/2 + (d*x)/2) - 1i)^5*(tan(c/2 + (d*x)/2) + 1i))

________________________________________________________________________________________

sympy [A]  time = 0.40, size = 165, normalized size = 2.32 \[ \begin {cases} \frac {\left (- 2560 i a^{6} d^{3} e^{10 i c} e^{i d x} + 7680 i a^{6} d^{3} e^{8 i c} e^{- i d x} + 2560 i a^{6} d^{3} e^{6 i c} e^{- 3 i d x} + 512 i a^{6} d^{3} e^{4 i c} e^{- 5 i d x}\right ) e^{- 9 i c}}{20480 a^{8} d^{4}} & \text {for}\: 20480 a^{8} d^{4} e^{9 i c} \neq 0 \\\frac {x \left (e^{6 i c} + 3 e^{4 i c} + 3 e^{2 i c} + 1\right ) e^{- 5 i c}}{8 a^{2}} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)/(a+I*a*tan(d*x+c))**2,x)

[Out]

Piecewise(((-2560*I*a**6*d**3*exp(10*I*c)*exp(I*d*x) + 7680*I*a**6*d**3*exp(8*I*c)*exp(-I*d*x) + 2560*I*a**6*d
**3*exp(6*I*c)*exp(-3*I*d*x) + 512*I*a**6*d**3*exp(4*I*c)*exp(-5*I*d*x))*exp(-9*I*c)/(20480*a**8*d**4), Ne(204
80*a**8*d**4*exp(9*I*c), 0)), (x*(exp(6*I*c) + 3*exp(4*I*c) + 3*exp(2*I*c) + 1)*exp(-5*I*c)/(8*a**2), True))

________________________________________________________________________________________